package yangsw87.basic;

public class J13_Q77_Books_OOP {

	public static void main(String[] args) {
		// 도서 관리 시스템 (OOP)
		J13_Book book
		= new J13_Book(12345,"누구나 알기쉬운 Java : 입문",
				"혜지원","카와바 타케시","미스테리 스릴러",22500,
				false,"2014-06-10 12:12:12");
		
		J13_Book[] books = new J13_Book[5];
		// 대여한 책을 저장하기 위해 배열 선언
		books[0]=book;	// 대여한 책을 배열에 저장
		
		
		J13_Member member
		= new J13_Member(98765, "수지", "123-456-789", books , 12345);
		
		// 도서정보 출력
		System.out.println(book.toString());
		
		
	} // main

} // class

class J13_Book{
	private int bookNo;
	private String bookName;
	private String publisher;
	private String author;
	private String genre;
	private int price;
	private boolean isRent;
	private String regDate;
	
	public J13_Book(int bookNo, String bookName, String publisher
			, String author, String genre, int price, boolean isRent,
			String regDate) {
		this.bookNo=bookNo;
		this.bookName=bookName;
		this.publisher=publisher;
		this.author=author;
		this.genre=genre;
		this.price=price;
		this.isRent=isRent;
		this.regDate=regDate;
	}
	
	@Override
	public String toString() {
		String bookInfo = "도서번호 : " + bookNo + "\n";
		bookInfo += "도서명 : " +bookName + "\n";
		bookInfo += "출판사 : " +publisher + "\n";
		bookInfo += "지은이 : " +author + "\n";
		bookInfo += "장르 : " + genre + "\n";
		bookInfo += "가격 : " + price + "\n";
		bookInfo += "대여여부 : " + isRent + "\n";
		bookInfo += "등록일 : " + regDate;
		
		return bookInfo;
	}
	
}

class J13_Member{
	private int memberNo;
	private String name;
	private String telNo;
//	private J13_Book rBook1;
//	private J13_Book rBook2;
//	private J13_Book rBook3;
//	private J13_Book rBook4;
//	private J13_Book rBook5;
	private J13_Book[] rBooks;
	private int mileage;
	
	public J13_Member(int memberNo, String name, String telNo,
			J13_Book[] rBooks, int mileage) {
		this.memberNo=memberNo;
		this.name=name;
		this.telNo=telNo;
		this.rBooks=rBooks;
		this.mileage=mileage;
	}
}